<div class="panel panel-default">
    <div class="panel-heading">海报设置<span style='color:red'>（若使用公众号二维码，请先去“参数设置-公众号设置”配置“联营公众号uniacid”）</span></div>
	<div class='panel-body' >
	    <div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span>海报分类</label>
			<div class="col-sm-9 col-xs-12">
				<select id="cateid" name="cateid" class="form-control cateid">
					<option value="">请选择海报分类</option>
					{loop $merchantcat $row}
						<option value="{$row['id']}" {if $row['id'] == $item['cateid']}selected="selected"{/if}>{$row['catename']}</option>
					{/loop}
				</select>
			</div>
		</div>
	    <div class="form-group" id="mall_type">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span> 海报类型：</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"><input type="radio" name="poster_type" value="1" {if $item['poster_type'] == 1}checked="true"{/if} /> 小程序海报</label>
				&nbsp;
				<label class="radio-inline"><input type="radio" name="poster_type" value="2" {if $item['poster_type'] == 2}checked="true"{/if} /> 公众号邀请海报、关注公众号自动回复内容</label>
				&nbsp;
				<label class="radio-inline"><input type="radio" name="poster_type" value="4" {if $item['poster_type'] == 4}checked="true"{/if} /> 小程序电商商品海报</label>
				&nbsp;
				<label class="radio-inline"><input type="radio" name="poster_type" value="3" {if $item['poster_type'] == 3}checked="true"{/if} /> 关注公众号自动回复电商商品</label>
				<span class="help-block" style="color:#f00">*公众号二维码除邀请海报是永久有效，其他公众号二维码有效期都是30天；</span>
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span> 海报名称</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" name="title" class="form-control" value="{$item['title']}" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span> 平台名称：</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" name="shopname" class="form-control" value="{$item['shopname']}" />
				<span class="help-block" style="color:#f00">*前端显示的平台名称</span>
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span> 平台图标：</label>
			<div class="col-sm-9 col-xs-12">
				{php echo tpl_form_field_image('shopavatar', $item['shopavatar'], '', array('extras' => array('text' => 'readonly')))}
				<span class="help-block" style="color:#f00">*前端显示的平台图标</span>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span>海报文案：</label>
			<div class="col-sm-9 col-xs-12">
				<textarea id="content" name="content" style="height:100px;" class="form-control">{$item['content']}</textarea>
			</div>
		</div>

		<div class="form-group" id="poster_design" {if $item['poster_type'] == 3}style="display:none;"{/if}>
			<label class="col-xs-12 col-sm-2 control-label"><span style='color:red'>*</span> 海报设计</label>
			<div class="col-sm-9 col-xs-12">
				<table style='width:100%;'>
					<tr>
						<td style='width:375px;padding:10px;background: antiquewhite;' valign='top'>
							<div id='poster' class="poster_data">
								<img src="{php echo tomedia($item['bg'])}" class='bg' /> 
								{if !empty($data)} 
									{loop $data $key $d}
										<div class="drag drag0" type="{$d['type']}" index="{php echo $key+1}" style="zindex:{php echo $key+1};left:{$d['left']};top:{$d['top']};width:{$d['width']};height:{$d['height']}" src="{$d['src']}" size="{$d['size']}" color="{$d['color']}">
											{if $d['type']=='qr'}
												<img src="../addons/{php echo MODULE_NAME}/static/img/qr.jpg" /> 
											{elseif $d['type']=='xcxqr'}
												<img src="../addons/{php echo MODULE_NAME}/static/img/xcxqr.jpg" /> 
											{elseif $d['type']=='head'}
												<img src="../addons/{php echo MODULE_NAME}/static/img/head.jpg" /> 
											{elseif $d['type']=='img' || $d['type']=='thumb'}
												<img src="{php echo empty($d['src'])?'../addons/'.MODULE_NAME.'/static/img/img.jpg':tomedia($d['src'])}" /> 
											{elseif $d['type']=='nickname'}
												<div class=text style="font-size:{$d['size']};color:{$d['color']}">昵称</div>
											{/if}
											<div class="rRightDown"> </div>
											<div class="rLeftDown"> </div>
											<div class="rRightUp"> </div>
											<div class="rLeftUp"> </div>
											<div class="rRight"> </div>
											<div class="rLeft"> </div>
											<div class="rUp"> </div>
											<div class="rDown"></div>
										</div>
									{/loop} 
								{/if}
							</div>

						</td>
						<td valign='top' style='padding:10px;'>
							<div class='panel panel-default'>
								<div class='panel-body'>
									<div class="form-group" id="bgset">
										<label class="col-xs-12 col-sm-3 col-md-2 control-label">背景图片</label>
										<div class="col-sm-9 col-xs-12">

											<div class="input-group ">
												<input type="text" name="bg" value="{$item['bg']}" class="form-control" autocomplete="off">
												<span class="input-group-btn">
													<button class="btn btn-default" type="button" onclick="showImageDialog(this);" data-original-title="" title="">选择图片</button>
												</span>
											</div>
											<div class="input-group " style="margin-top:.5em;">
												<img src="{php echo tomedia($item['bg'])}" class="img-responsive img-thumbnail" width="150" title="图片未找到.">
												<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除这张图片" onclick="deleteImage(this)">×</em>
											</div>		

											<span class='help-block' style="color:red;">宽度为750px， 宽度为750px ， 宽度为750px，高度不限</span>
										</div>

									</div>
									<div class="form-group" id="poster_btn">
										<label class="col-xs-12 col-sm-3 col-md-2 control-label">海报元素</label>
										<div class="col-sm-9 col-xs-12">
											<button class='btn btn-default btn-com' type='button' data-type='head'>头像</button>
											<button class='btn btn-default btn-com' type='button' data-type='nickname'>昵称</button>
											<button class='btn btn-default btn-com' type='button' data-type='qr'>公众号二维码</button>
											<button class='btn btn-default btn-com' type='button' data-type='xcxqr'>小程序二维码</button>
											<button class='btn btn-default btn-com' type='button' data-type='img'>图片</button>
											<span class="help-block" style="color:#f00">*请去小程序后台【开发管理-开发配置-服务器域名】添加小程序域名及微擎远程附件域名（如有）到downloadfile域名里面，微擎远程附件域名需要https域名；</span>
											<span class="help-block" style="color:#f00">*若使用头像，请去小程序后台【开发管理-开发配置-服务器域名】添加https://thirdwx.qlogo.cn到downloadfile域名里面；</span>
										</div>
										
									</div>
									<div id='nameset' style='display:none'>
										<div class="form-group">
											<label class="col-xs-12 col-sm-3 col-md-2 control-label">文字颜色</label>
											<div class="col-sm-9 col-xs-12">
												{php echo tpl_form_field_color('color')}
											</div>
										</div>
										<div class="form-group">
											<label class="col-xs-12 col-sm-3 col-md-2 control-label">文字大小</label>
											<div class="col-sm-4">
												<div class='input-group'>
													<input type="text" id="namesize" class="form-control namesize" placeholder="例如: 14,16" />
													<div class='input-group-addon'>px</div>
												</div>
											</div>
										</div>
									</div>
									<div class="form-group" id="imgset" style="display:none">
										<label class="col-xs-12 col-sm-3 col-md-2 control-label">图片设置</label>
										<div class="col-sm-9 col-xs-12">
											<div class="input-group ">
												<input type="text" name="img" value="" class="form-control" autocomplete="off">
												<span class="input-group-btn">
													<button class="btn btn-default" type="button" onclick="showImageDialog(this);" data-original-title="" title="">选择图片</button>
												</span>
											</div>
											<div class="input-group " style="margin-top:.5em;">
												<img src="" class="img-responsive img-thumbnail" width="150" title="图片未找到.">
												<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除这张图片" onclick="deleteImage(this)">×</em>
											</div>
										</div>
									</div>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label">是否关注公众号才显示：</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"><input type="radio" name="is_gzh" value="0" {if $item['is_gzh'] == 0}checked="true"{/if}{if !$item['is_gzh']}checked="true"{/if} /> 不限制</label>
				&nbsp;&nbsp;&nbsp;
				<label class="radio-inline"><input type="radio" name="is_gzh" value="1" {if $item['is_gzh'] == 1}checked="true"{/if} /> 关注才显示</label>
				&nbsp;&nbsp;&nbsp;
				<label class="radio-inline"><input type="radio" name="is_gzh" value="2" {if $item['is_gzh'] == 2}checked="true"{/if} /> 没关注才显示</label>
				<span class="help-block" style="color:#f00">是否关注公众号才显示</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label">是否有推荐人才显示：</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"><input type="radio" name="is_tjr" value="0" {if $item['is_tjr'] == 0}checked="true"{/if}{if !$item['is_tjr']}checked="true"{/if} /> 不限制</label>
				&nbsp;&nbsp;&nbsp;
				<label class="radio-inline"><input type="radio" name="is_tjr" value="1" {if $item['is_tjr'] == 1}checked="true"{/if} /> 有推荐人才显示</label>
				&nbsp;&nbsp;&nbsp;
				<label class="radio-inline"><input type="radio" name="is_tjr" value="2" {if $item['is_tjr'] == 2}checked="true"{/if} /> 没有推荐人才显示</label>
				<span class="help-block" style="color:#f00">是否有推荐人才显示</span>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label">手机系统配置：</label>
			<div class="col-sm-9 col-xs-12">
				<label class="radio-inline"><input type="radio" name="system_type" value="0" {if $item['system_type'] == 0 || !$item['system_type']}checked="true"{/if} /> 全平台显示</label>
				&nbsp;&nbsp;&nbsp;
				<label class="radio-inline"><input type="radio" name="system_type" value="1" {if $item['system_type'] == 1}checked="true"{/if} /> IOS系统不显示</label>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label">发布时间：</label>
			<div class="col-sm-9 col-xs-12">
				{php echo tpl_form_field_date('createtime',date('Y-m-d H:i:s',$item['createtime']),true);}
				<span class="help-block" style="color:#f00">*前端按发布时间降序排列；</span>
			</div>
		</div>

        <div class="form-group">
			<label class="col-xs-12 col-sm-2 control-label">是否启用海报</label>
			<div class="col-sm-9 col-xs-12">
				<label class='radio-inline'>
                	<input type='radio' value="0" name='isopen' {if intval($item['isopen'])=='0'}checked{/if}> 否
                </label>
				<label class='radio-inline'>
                	<input type='radio' value="1" name='isopen' {if $item['isopen']=='1'}checked{/if}> 是
                </label>
			</div>
		</div>
		
	</div>
</div>